/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package admin_gui;

/**
 *
 * @author WEN
 */
import Exception.SystemException;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author WEN
 */
public class AdminGUI {

    private JFrame frame;
    private Container pane;
//    private POSController posControl;

    public AdminGUI() {
    }

    public void build() {
        frame = new JFrame();
        frame.setTitle("DigiStore");
        frame.setBackground(Color.white);
        frame.setSize(850, 650);
        pane = frame.getContentPane();
        pane.getPreferredSize();
        LogInScreen();
        frame.pack();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        frame.setLocation(((int) screenSize.getWidth() / 2) - frame.getWidth()
                / 2, ((int) screenSize.getHeight() / 2) - frame.getHeight() / 2);
        frame.setResizable(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
    }

    public void LogInScreen() {
        Admin_Login login = new Admin_Login(this);
        login.setBounds(0, 0, 1024, 767);
        pane.getPreferredSize();
        pane.removeAll();
        pane.add(login);
        pane.validate();
        pane.repaint();
    }

    public void ManageScreen(){
        Admin_Manage manageForm = null;
        manageForm = new Admin_Manage(this);
        manageForm.setBounds(0, 0, 1024, 767);
        pane.removeAll();
        pane.add(manageForm);
        pane.validate();
        pane.repaint();
    }
}
